<?php $this->load->view('layout/header'); ?>
<form name="form1" method="post" action="<?php echo b_url('extension/extension_action').'/'.$info['adpositionid'];?>" id="form1">

    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>
                    广告位
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>广告位名称：
                </td>
                <td>
                    <input name="adpositionname" type="text" id="adpositionname" value="<?php echo $info['adpositionname']?>" />
                    <span id="adpositionname_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    广告位介绍：
                </td>
                <td>
                    <textarea name="adpositionintro" rows="8" cols="40" id="adpositionintro"><?php echo $info['adpositionintro']?></textarea>
                    &nbsp;
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>广告位类型：
                </td>
                <td>
                    <select name="typeid" id="typeid">
                        <?php foreach($this->typeArr as $k=>$v) :?>
                    	<option value="<?php echo $k;?>" <?php if($info['typeid'] == $k){echo "selected='selected'";}?>><?php echo $v;?></option>
                        <?php endforeach ; ?>
                    </select>
                    <span id="typeid_tips" style="color:Red;display:none;">请选择</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>宽度：
                </td>
                <td>
                    <input name="width" num="true" type="text" id="width" value="<?php echo $info['width']?>"/>
                    <span id="width_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="width_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>高度：
                </td>
                <td>
                    <input name="height" num="true" type="text" id="height" value="<?php echo $info['height']?>" />
                    <span id="height_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="height_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>广告位价格：
                </td>
                <td>
                    <input name="price" num="price" type="text" value="<?php echo $info['price']?$info['price']:0;?>" id="txtAdPrice" />
                    元/月
                    <span id="price_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="price_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>排序号：
                </td>
                <td>
                    <input name="listid" num="true" type="text" value="<?php echo $info['listid']?$info['listid']:0;?>" id="txtAdId" />
                    <span id="listid_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="listid_num_tips" style="color:Red;display:none;">只能为数字</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    是否关闭：
                </td>
                <td>
                    <span id="radIsClose">
                        <input id="radIsClose_0" type="radio" name="isclose" value="1" <?php if($info['isclose'] == 1){echo 'checked="checked"';}?> /><label for="radIsClose_0">是</label>
                        <input id="radIsClose_1" type="radio" name="isclose" value="0" <?php if($info['isclose'] == 0 || empty($info)){echo 'checked="checked"';}?> /><label for="radIsClose_1">否</label>
                    </span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="submit"  value="保存" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSave&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSave" />
                    <input type="button"  value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>

<script type="text/javascript">
$('#form1').submit(function() {
	var is = true;
	if (!input_tips($('#adpositionname'))) {
	    is = false;
	}
	if (!selete_tips($('#typeid'))) {
	    is = false;
	}
	if (!input_tips($('#width'))) {
	    is = false;
	}
	if (!input_tips($('#height'))) {
	    is = false;
	}
	if (!input_tips($('#price'))) {
	    is = false;
	}
	if (!input_tips($('#listid'))) {
	    is = false;
	}
	return false;
})
</script>
<?php $this->load->view('layout/footer'); ?>
